package com.lqk.java1;

/**
 * @author liqiankun
 * @date 2022/11/10 14:30
 * @description
 **/
@MyAnnotation(value = "person类")
public class Person extends Creature<String> implements Comparable<String>, MyInterface{
    private static final long serialVersionUID = -4464232509829829658L;

    private String name;

    int age;

    public int id;

    public Person(){

    }

    @MyAnnotation(value = "构造器")
    private Person(String name){
        this.name = name;
    }

    Person(String name, int age){
        this.name = name;
        this.age = age;
    }

    @MyAnnotation(value = "方法")
    private String show(String nation){
        System.out.println("我的国籍是"+nation);
        return nation;
    }

    public String display(String interests){
        return interests;
    }

    String display(String interests, int age) throws NullPointerException, ClassCastException{
        return interests + age;
    }

    @Override
    public void info() {
        System.out.println("我是一个人");
    }

    @Override
    public int compareTo(String o) {
        return 0;
    }

    private static void showDesc(){
        System.out.println("我是一个可爱的人!!!");
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", id=" + id +
                '}';
    }
}
